package com.wms.controller;

import com.wms.entity.WEntryStore;
import com.wms.mytool.Result;
import com.wms.service.WEntryStoreService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 入库单表(WEntryStore)表控制层
 * @author Li Xiaoyu
 * @since 2023-10-22 21:32:42
 */
@RestController
@RequestMapping("/entryStore")
public class WEntryStoreController {
    /**
     * 服务对象
     */
    @Resource
    private WEntryStoreService wEntryStoreService;

    /**
     * 查询所有入库信息
     * @return 实例对象
     */
    @GetMapping("/selectAll")
    public Result selectAll(){
        return this.wEntryStoreService.selectAll();
    }

    /**
     * 添加入库信息
     * @param wEntryStore 入库信息
     * @return 实例对象
     */
    @PostMapping("/addInStore")
    public Result addInStore(@RequestBody List<WEntryStore> wEntryStore){
        return this.wEntryStoreService.addInStore(wEntryStore);
    }

    /**
     * 删除入库信息
     * @param id 入库id
     * @return 实例对象
     */
    @DeleteMapping("/{id}")
    public Result deleteInStore(@PathVariable("id") Integer id){
        return this.wEntryStoreService.deleteInStore(id);
    }
}

